class Solution {
     public void removeDuplicates(int[] nums){
        for(int left = 0,right = 0; right < nums.length; right++){
            if(nums[left] != nums[right]){
                left++;
                int tmp = nums[left];
                nums[left] = nums[right];
                nums[right] = tmp;
            }
        }
    }
}